const express = require('express')
const app = express()

app.use((req, res, next) => {
    // 获取到请求到服务器的时间
    const time = Date.now()
    req.startTime = time
    next()
})


app.get('/', (req, res) => {
    console.log('dsad');
    res.send('page home' + req.startTime)
})

app.get('/user', (req, res) => {
    res.send('USER home' + req.startTime)
})

app.listen(8082, () => {
    console.log('http://127.0.0.1:8082');
})